package com.sgcc.lms.config;

import com.sgcc.lms.bean.Person;
import com.sgcc.lms.condition.LinuxCondition;
import com.sgcc.lms.condition.WindowsCondition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: 李孟帅
 * @CreateTime: 2020-11-27 15:14
 * @Description:
 */
@Configuration
public class Config3 {

    @Bean("lisi")
    @Conditional(WindowsCondition.class)
    public Person user01() {
        Person person = new Person("lisi", 15);
        return person;
    }

    @Bean("ww")
    @Conditional(LinuxCondition.class)
    public Person user03() {
        Person person = new Person("ww", 22);
        return person;
    }
}
